﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
//
using CommonClass;
using System.Configuration;
using System.Diagnostics;
using CommonBase;


namespace MatrixManagement
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            // 限制一台电脑只能运行一个程序
            string procName = Process.GetCurrentProcess().ProcessName;
            Process[] processes = Process.GetProcessesByName(procName);

            if (processes.Length >= 2)
            {
                MessageBox.Show("请不要运行多个系统！", ConstantString.MSG_COMPANY);
                Application.Exit();

                return;
            }

            if (ConfigurationManager.AppSettings.AllKeys.Contains("DebugModel"))
                Utilities.DebugModel = bool.Parse(ConfigurationManager.AppSettings["DebugModel"]); // 获取 Debug Model 的值

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frm_Main());
        }
    }
}
